<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="./vue.js"></script>
</head>
<body>
    <div id="app">
        <h1>{{msg}}</h1>

        <div>
            <h2>兴趣多个</h2>
            <label for="">打lol</label>
            <input type="checkbox" v-model='hobby' value="1">
            <label for="">洗脚</label>
            <input type="checkbox" v-model='hobby' value="2">
            <label for="">敲代码</label>
            <input type="checkbox" v-model='hobby' value="3">

            <button @click='myHobby'>点击获取爱好</button>
        </div>
    </div>
    <script>
        var vm = new Vue({
            el:'#app',
            data:{
                msg:'vue',
                hobby:['2']
            },
            methods:{
                myHobby(){
                    console.log(this.hobby)
                }
            }
        })
    </script>
</body>
</html>